﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Coldairarrow.Entity.Interface
{
    /// <summary>
    /// 库存库龄
    /// </summary>
    /// 
    public class RE_AsnList
    {
        /// <summary>
        /// ID
        /// </summary>
        public string ID { get; set; }
        public string RowId { get; set; }


        /// <summary>
        /// 入库单号
        /// </summary>
        public string receiving_code { get; set; }
        /// <summary>
        /// 客户参考号
        /// </summary>
        public string reference_no { get; set; }
        /// <summary>
        /// 合同号
        /// </summary>
        public string contract_no { get; set; }
        /// <summary>
        /// 入库单类型，0-标准入库单，1-FBA入库单，2-FBA整箱备货
        /// </summary>
        public string asn_type_;
        public string asn_type
        {

            get { return asn_type_; }

            set
            {
                if (value == "0") asn_type_ = "标准入库单";
                else if (value == "1") asn_type_ = "FBA入库单";
                else if (value == "2") asn_type_ = "FBA整箱备货";
                else asn_type_ = value;
            }

        }
        /// <summary>
        /// 中转类型，0中转代发，1自发头程
        /// </summary>
        public string transit_type_;
        public string transit_type
        {

            get { return transit_type_; }

            set
            {
                if (value == "0") transit_type_ = "中转代发";
                else if (value == "1") transit_type_ = "自发头程";
                else transit_type_ = value;
            }

        }

        /// <summary>
        /// 交货方式，0自送，1揽收
        /// </summary>
        public string income_type_;
        public string income_type
        {

            get { return income_type_; }

            set
            {
                if (value == "0") income_type_ = "自送";
                else if (value == "1") income_type_ = "揽收";
                else income_type_ = value;
            }

        }
        /// <summary>
        /// 目的仓库
        /// </summary>
        public string warehouse_code { get; set; }
        /// <summary>
        /// 交货仓库
        /// </summary>
        public string transit_warehouse_code { get; set; }
        /// <summary>
        /// 头程运输方式
        /// </summary>
        public string sm_code { get; set; }
        /// <summary>
        /// 运输方式
        /// </summary>
        public string shipping_method { get; set; }
        /// <summary>
        /// 跟踪号
        /// </summary>
        public string tracking_number { get; set; }
        /// <summary>
        /// 入库单状态 C:新建 W:头程在途 P:头程收货中 T:头程收货完成 Z:转运中 G:目的仓库收货中 F:目的仓收货完成 E:完成上架 X:废弃
        /// </summary>
        public string receiving_status_;
        public string receiving_status
        {

            get { return receiving_status_; }

            set
            {
                if (value == "C") receiving_status_ = "新建";
                else if (value == "W") receiving_status_ = "头程在途";
                else if (value == "P") receiving_status_ = "头程收货中";
                else if (value == "T") receiving_status_ = "头程收货完成";
                else if (value == "Z") receiving_status_ = "转运中";
                else if (value == "G") receiving_status_ = "目的仓库收货中";
                else if (value == "F") receiving_status_ = "目的仓收货完成";
                else if (value == "E") receiving_status_ = "完成上架";
                else if (value == "X") receiving_status_ = "废弃";
                else receiving_status_ = value;
            }

        }
        /// <summary>
        /// 入库单说明
        /// </summary>
        public string receiving_desc { get; set; }
        /// <summary>
        /// 预计到达日期
        /// </summary>
        public string eta_date { get; set; }
        /// <summary>
        /// 创建日期
        /// </summary>
        public string receiving_add_time { get; set; }
        /// <summary>
        /// 修改日期
        /// </summary>
        public string receiving_modify_time { get; set; }
        /// <summary>
        /// 目的仓收货时间
        /// </summary>
        public string warehouse_receiving_time { get; set; }
        /// <summary>
        /// 目的仓收货完成时间
        /// </summary>
        public string warehouse_receiving_complete_time { get; set; }
        /// <summary>
        /// 目的仓上架时间
        /// </summary>
        public string warehouse_shelf_time { get; set; }
        /// <summary>
        /// 揽收支持的省ID， 参考getRegionForReceiving
        /// </summary>
        public string region_id_level0 { get; set; }
        /// <summary>
        /// 揽收支持的市ID， 参考getRegionForReceiving
        /// </summary>
        public string region_id_level1 { get; set; }
        /// <summary>
        /// 揽收支持的区ID， 参考getRegionForReceiving
        /// </summary>
        public string region_id_level2 { get; set; }
        /// <summary>
        /// 揽收地址
        /// </summary>
        public string street { get; set; }
        /// <summary>
        /// 联系人，交货方式为揽收时，必填
        /// </summary>
        public string contacter { get; set; }
        /// <summary>
        /// 联系电话，交货方式为揽收时，必填
        /// </summary>
        public string contact_phone { get; set; }
        /// <summary>
        /// 总箱数
        /// </summary>
        public decimal box_total { get; set; }
        /// <summary>
        /// 产品总数
        /// </summary>
        public decimal sku_total { get; set; }
        /// <summary>
        /// SKU种类
        /// </summary>
        public string sku_species { get; set; }

        /// <summary>
        /// 计费时间
        /// </summary>
        public string calculate_fee_time { get; set; }
        /// <summary>
        /// VAT税号
        /// </summary>
        public string vat_tax_code { get; set; }
        /// <summary>
        /// 入库单成本
        /// </summary>
        public List<Receiving_Cost> receiving_cost { get; set; }

        public class Receiving_Cost
        {
            /// <summary>
            /// 总成本
            /// </summary>
            public string total_cost { get; set; }
            /// <summary>
            /// 运输费
            /// </summary>
            public string shipping_cost { get; set; }
            /// <summary>
            /// 报关费
            /// </summary>
            public string ccf_cost { get; set; }
            /// <summary>
            /// 关税
            /// </summary>
            public string dt_cost { get; set; }
            /// <summary>
            /// 其他费用
            /// </summary>

            public string other_cost { get; set; }
            /// <summary>
            /// 客户币种
            /// </summary>

            public string customer_currency { get; set; }
        }

        /// <summary>
        /// 货柜类型：0-空，1-20GP，2-40GP，3-40HQ，4-45GP，5-45HQ，6-53HQ，7:20HQ
        /// </summary>
        public string container_type_;
        public string container_type
        {

            get { return container_type_; }

            set
            {
                if (value == "0") container_type_ = "";
                else if (value == "1") container_type_ = "20GP";
                else if (value == "2") container_type_ = "40GP";
                else if (value == "3") container_type_ = "40HQ";
                else if (value == "4") container_type_ = "45GP";
                else if (value == "5") container_type_ = "45HQ";
                else if (value == "6") container_type_ = "53HQ";
                else if (value == "7") container_type_ = "20HQ";
                else container_type_ = value;
            }

        }
        /// <summary>
        /// 散货类型(托)：0-否，1-是
        /// </summary>
        public string bulk_cargo_type_;
        public string bulk_cargo_type
        {

            get { return bulk_cargo_type_; }

            set
            {
                if (value == "0") bulk_cargo_type_ = "否";
                else if (value == "1") bulk_cargo_type_ = "是";
                else bulk_cargo_type_ = value;
            }

        }
        /// <summary>
        /// 散货类型为托时的托数量，值为0时代表空
        /// </summary>
        public string pallet_cnt { get; set; }

        /// <summary>
        /// 库存批次号信息
        /// </summary>
        public List<Items> items { get; set; }

        /// <summary>
        /// SKU
        /// </summary>
        public string items_product_sku { get; set; }
        /// <summary>
        /// 产品编码
        /// </summary>
        public string items_product_barcode { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        public decimal items_quantity { get; set; }
        /// <summary>
        /// 收货数
        /// </summary>
        public decimal items_received_quantity { get; set; }

        /// <summary>
        /// 上架数
        /// </summary>
        public decimal items_putaway_qty { get; set; }

        /// <summary>
        /// 箱号
        /// </summary>
        public string items_box_no { get; set; }

        /// <summary>
        /// 库位类型统计数量,数组三条数据分表代表良品库位数量，不良品库位数量，暂存库位数量
        /// </summary>
        //public string loCountType { get; set; }

        /// <summary>
        /// 上架数量
        /// </summary>
        public decimal items_putaway_quantity { get; set; }

        /// <summary>
        /// 产品单价
        /// </summary>
        public decimal items_product_price { get; set; }

        /// <summary>
        /// 产品生产日期
        /// </summary>
        public string items_product_date { get; set; }

        /// <summary>
        /// 产品批次属性编码
        /// </summary>
        public string items_product_batch_code { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public string items_rd_update_time { get; set; }

        /// <summary>
        /// 箱维度库存类型：0 = 按仓库确认（默认），1 = 标准，2 = 暂存
        /// </summary>

        public string items_inventory_type { get; set; }
        public class Items
        {
            /// <summary>
            /// SKU
            /// </summary>
            public string product_sku { get; set; }
            /// <summary>
            /// 产品编码
            /// </summary>
            public string product_barcode { get; set; }
            /// <summary>
            /// 数量
            /// </summary>
            public decimal quantity { get; set; }
            /// <summary>
            /// 收货数
            /// </summary>
            public decimal received_quantity { get; set; }

            /// <summary>
            /// 上架数
            /// </summary>
            public decimal putaway_qty { get; set; }

            /// <summary>
            /// 箱号
            /// </summary>
            public string box_no { get; set; }

            /// <summary>
            /// 库位类型统计数量,数组三条数据分表代表良品库位数量，不良品库位数量，暂存库位数量
            /// </summary>
            //public string loCountType { get; set; }

            /// <summary>
            /// 上架数量
            /// </summary>
            public decimal putaway_quantity { get; set; }

            /// <summary>
            /// 产品单价
            /// </summary>
            public decimal product_price { get; set; }

            /// <summary>
            /// 产品生产日期
            /// </summary>
            public string product_date { get; set; }

            /// <summary>
            /// 产品批次属性编码
            /// </summary>
            public string product_batch_code { get; set; }

            /// <summary>
            /// 更新时间
            /// </summary>
            public string rd_update_time { get; set; }

            /// <summary>
            /// 箱维度库存类型：0 = 按仓库确认（默认），1 = 标准，2 = 暂存
            /// </summary>
            public string inventory_type_;

            public string inventory_type
            {
                get { return inventory_type_; }

                set
                {

                    if (value == "0") inventory_type_ = "按仓库确认";
                    else if (value == "1") inventory_type_ = "标准";
                    else if (value == "2") inventory_type_ = "暂存";
                    else inventory_type_ = value;
                }
            }



            /// <summary>
            /// 入库单产品每一种库位类型的数量
            /// </summary>
            public List<string> loTypeCount { get; set; }

            /// <summary>
            /// 产品仓库属性
            /// </summary>
            public dynamic  warehouse_attr { get; set; }

            public class Warehouse_Attr
            {
                /// <summary>
                /// 长
                /// </summary>
                public string product_length { get; set; }
                /// <summary>
                /// 宽
                /// </summary>
                public string product_width { get; set; }
                /// <summary>
                /// 高
                /// </summary>
                public string product_height { get; set; }
                /// <summary>
                /// 重
                /// </summary>
                public string product_weight { get; set; }
                

            }


            /// <summary>
            /// 产品成本
            /// </summary>
            public List<Receiving_Cost> product_cost { get; set; }
        }


        /// <summary>
        /// 库存批次号信息
        /// </summary>
        public List<Batch_Info> batch_info { get; set; }
        public class Batch_Info
        {
            /// <summary>
            /// 产品sku
            /// </summary>
            public string product_sku { get; set; }

            /// <summary>
            /// 产品代码
            /// </summary>
            public string product_barcode { get; set; }

            /// <summary>
            /// 产品数量
            /// </summary>
            public string sku_quantity { get; set; }

            /// <summary>
            /// 产品库存批次号
            /// </summary>
            public string inventory_code { get; set; }

            /// <summary>
            /// 库存类型,0:标准 1:不良品,2暂存
            /// </summary>
            public string ib_type_;

            public string ib_type
            {
                get { return ib_type_; }

                set
                {

                    if (value == "0") ib_type_ = "标准";
                    else if (value == "1") ib_type_ = "不良品";
                    else if (value == "2") ib_type_ = "暂存";
                    else ib_type_ = value;
                }
            }

            /// <summary>
            /// 上架时间
            /// </summary>
            public string warehouse_shelf_time { get; set; }
        }

        /// <summary>
        /// 上架记录
        /// </summary>
        public List<Shelf_Inventory_Records> shelf_inventory_records { get; set; }


        public class Shelf_Inventory_Records
        {
            /// <summary>
            /// 产品代码
            /// </summary>
            public string product_barcode { get; set; }
            /// <summary>
            /// 产品数量
            /// </summary>
            public string sku_quantity { get; set; }
            /// <summary>
            /// 库存类型,0:标准 1:不良品,2暂存
            /// </summary>
            public string ib_type_;

            public string ib_type
            {
                get { return ib_type_; }

                set
                {

                    if (value == "0") ib_type_ = "标准";
                    else if (value == "1") ib_type_ = "不良品";
                    else if (value == "2") ib_type_ = "暂存";
                    else ib_type_ = value;
                }
            }
            /// <summary>
            /// 上架时间
            /// </summary>
            public string warehouse_shelf_time { get; set; }

        }
    }

}
